package com.efuture.io;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @ClassNAME FileReaderTest
 * @Description FileWriter的使用
 * @Author zhaoshanshan
 * @Date 2021/9/8 8:44 下午
 * @Version 1.0
 */
public class FileWriterTest {

    public static void main(String[] args) {
        {
            FileWriter fw = null;
            try {
                fw = new FileWriter("javasestudy/src/com.efuture.io/TestFileFour.txt",true);
                String s = "我是中国人\n";
                fw.write(s);
                fw.flush();
            } catch (IOException e) {
                e.printStackTrace();
            }finally {
                try {
                    fw.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }

            }
        }
    }

}